﻿@using DevExpress.Web.Mvc.UI
@using Dogshow.Web.Utils
@model Dogshow.Web.ViewModels.Korisnici.KorisnikViewModel

<div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Vrsta naloga:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "VrstaKorisnika";
        }).GetHtml()
        @Html.DevExpress().ComboBox(s =>
        {
            s.Name = "VrstaKorisnika";
            s.ShowModelErrors = true;
            s.Properties.DropDownRows = 3;
            s.Properties.ValueType = typeof(int);
            s.Properties.ValueField = "Id";
            s.Properties.TextField = "Naziv";
            s.Properties.EnableCallbackMode = false;
            s.ControlStyle.CssClass = "editor";
            s.Properties.ClientSideEvents.ValueChanged = "onVrstaKorisnikaValueChanged";
        }).BindList(Model.VrsteKorisnika).Bind(Model.Korisnik.VrstaKorisnika).GetHtml()
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Korisničko ime:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "KorisnickoIme";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "KorisnickoIme";
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.KorisnickoIme).GetHtml()
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Naziv korisnika:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "Naziv";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "Naziv";
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.Naziv).GetHtml()
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Lozinka:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "VidljivaLozinka";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "VidljivaLozinka";
            //textEdit.Properties.Password = true;
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.VidljivaLozinka).GetHtml()
    </div>
    
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Adresa:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "Adresa";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "Adresa";
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.Adresa).GetHtml()
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Mesto:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "IdMesta";
        }).GetHtml()
        @Html.PartialOrNull("MestaCombo", Model.Korisnik.IdMesta)
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "Telefon:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "Telefon";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "Telefon";
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.Telefon).GetHtml()
    </div>
    <div class="line">
        @Html.DevExpress().Label(label =>
        {
            label.Text = "E-Mail:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "Email";
        }).GetHtml()
        @Html.DevExpress().TextBox(textEdit =>
        {
            textEdit.Name = "Email";
            textEdit.Properties.ConvertEmptyStringToNull = true;
            textEdit.ShowModelErrors = true;
            textEdit.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.Email).GetHtml()
    </div>
    <div class="line">
    @Html.DevExpress().Label(label =>
        {
            label.Text = "Aktivan:";
            label.ControlStyle.CssClass = "label";
            label.AssociatedControlName = "Aktivan";
        }).GetHtml()
        @Html.DevExpress().CheckBox(checkBoxSettings =>
        {
            checkBoxSettings.Name = "Aktivan";
            checkBoxSettings.ControlStyle.CssClass = "editor";
        }).Bind(Model.Korisnik.Aktivan).GetHtml()
    </div>